package com.geyue.controller;

import com.geyue.common.constant.Constant;
import com.geyue.core.model.Home;
import com.geyue.core.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Lyon on 2017/4/20.
 */
@RestController
@RequestMapping("/api/home")
public class HomeController {

    @Autowired
    private HomeService homeService;

    @RequestMapping(value = "/banner",method = RequestMethod.GET)
    public Object banner(){
        Home home = new Home();
        home.setType(Constant.HOME_BANNER);
        return homeService.getList(home);
    }

    @RequestMapping(value = "/teacher",method = RequestMethod.GET)
    public Object teacher(){
        Home home = new Home();
        home.setType(Constant.HOME_TEACHER);
        return homeService.getList(home);
    }

    @RequestMapping(value = "/footer",method = RequestMethod.GET)
    public Object footer(){
        Home home = new Home();
        home.setType(Constant.HOME_FOOTER);
        return homeService.getList(home);
    }
}
